unsigned long phys_l1tab, phys_l2tab;
unsigned long cur_address, alloc_address;
unsigned long virt_load_address, virt_stack_address, virt_shinfo_address;
+ unsigned long virt_ftable_start, virt_ftable_end, ft_mapping;
start_info_t *virt_startinfo_address;
unsigned long long time;
unsigned long count;
unsigned long alloc_index;
+ unsigned long ft_pages;
l2_pgentry_t *l2tab, *l2start;
l1_pgentry_t *l1tab = NULL;
struct pfn_info *page = NULL;
p->mm.pagetable = mk_pagetable(phys_l2tab);
/*
- * NB. The upper limit on this loop does one extra page. This is to
- * make sure a pte exists when we want to map the shared_info struct.
+ * NB. The upper limit on this loop does one extra page + pages for frame table.
+ * This is to make sure a pte exists when we want to map the shared_info struct
+ * and frame table struct.
*/
+ ft_pages = (frame_table_size + (PAGE_SIZE - 1)) << PAGE_SHIFT;
l2tab += l2_table_offset(virt_load_address);
cur_address = p->pg_head << PAGE_SHIFT;
for ( count = 0;
(virt_load_address + ((alloc_index - 1) << PAGE_SHIFT));
virt_stack_address = (unsigned long)virt_startinfo_address;
+ /* set up frame_table mapping */
+ ft_mapping = (unsigned long)frame_table;
+ virt_ftable_start = virt_shinfo_address + PAGE_SIZE;
+ virt_ftable_end = virt_ftable_start + frame_table_size;
+ for(cur_address = virt_ftable_start;
+ cur_address < virt_ftable_end;
+ cur_address += PAGE_SIZE){
+ l2tab = l2start + l2_table_offset(cur_address);
+ l1tab = map_domain_mem(l2_pgentry_to_phys(*l2tab));
+ l1tab += l1_table_offset(cur_address);
+ *l1tab = mk_l1_pgentry(__pa(ft_mapping)|L1_PROT);
+ unmap_domain_mem(l1tab);
+ ft_mapping += PAGE_SIZE;
+ }
+
unmap_domain_mem(l2start);
/* Install the new page tables. */
virt_startinfo_address->pt_base = virt_load_address +
((p->tot_pages - 1) << PAGE_SHIFT);
virt_startinfo_address->phys_base = p->pg_head << PAGE_SHIFT;
+ virt_startinfo_address->frame_table = virt_ftable_start;
/* Add virtual network interfaces and point to them in startinfo. */
while (params->num_vifs-- > 0) {
#define DOM_DIR "dom"
#define DOM_MEM "mem"
+frame_table_t * frame_table;
+
static struct proc_dir_entry *xeno_base;
static struct proc_dir_entry *dom0_cmd_intf;
static struct proc_dir_entry *proc_ft;
/* remap the range using xen specific routines */
+ printk(KERN_ALERT "bd240 debug: dmw entered %lx, %lx\n", mem_data->pfn, mem_data->tot_pages);
+
addr = direct_mmap(mem_data->pfn << PAGE_SHIFT, mem_data->tot_pages << PAGE_SHIFT, prot, 0, 0);
+
+ printk(KERN_ALERT "bd240 debug: dmw exit %lx, %lx\n", mem_data->pfn, mem_data->tot_pages);
copy_to_user((unsigned long *)buff, &addr, sizeof(addr));
static int __init init_module(void)
{
+ frame_table = (frame_table_t *)start_info.frame_table;
+
/* xeno proc root setup */
xeno_base = proc_mkdir(XENO_BASE, &proc_root);